﻿@using SQLiteCoreDB.Models;

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="~/Content/layui-v2.8.15/layui/css/layui.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-3.4.1.min.js"></script>
    <script src="~/Content/layui-v2.8.15/layui/layui.js"></script>
    <script src="~/Content/layui-v2.8.15/layui/axios.min.js"></script>

    <script type="text/javascript">
        /*去掉字符串两侧空格*/
        String.prototype.myTrim = function () {
            return this.replace(new RegExp("^\\s*|\\s*$", "g"), "");
        }
    </script>

    <title>@ViewBag.Title - 文件浏览</title>
    <style>
        .layui-nav-item {
            padding: 0 25px;
        }
    </style>
    <script>
        const token = localStorage.getItem('jwtToken');
        axios.defaults.headers.common['Authorization'] = `Bearer ${token}`;
    </script>
    @RenderSection("css", required: false)
</head>
<body>
    <ul class="layui-nav">
        @if (@ViewBag.dirNew != null)
        {
            <li class="layui-nav-item">
                <a href="javascript:void(0);" onclick="(history.go(-1))">
                    <i class="layui-icon layui-icon-return"></i> 返 回
                </a>
            </li>

        }

        <li class="layui-nav-item">
            <a href="/Home/FileList"><i class="layui-icon layui-icon-home"></i>  @(KeyValueConfig.FileSaveDir?.Substring(3))</a>

        </li>

        <li class="layui-nav-item">

            <a href="/Home/User">
                <span>当前用户：</span>
                <span> <i class="layui-icon layui-icon-username"></i> <b>@LoginMode.username</b></span>
            </a>
            <dl class="layui-nav-child">
                <dd style="text-align: center;"><a href="/LoginHandle/ExitLogin"> <i class="layui-icon layui-icon-logout"></i> 退出</a></dd>
            </dl>
        </li>
        @if (LoginMode.admin || !LoginMode.LV.Equals("1"))
        {
            <li class="layui-nav-item">
                <a href="#" lay-on="page"><i class="layui-icon layui-icon-add-1"></i>创建文件夹</a>
            </li>


            <li class="layui-nav-item">
                <a href="#" lay-on="iframe">
                    <i class="layui-icon layui-icon-upload"></i>
                    上传文件
                </a>
            </li>
        }
        @if (LoginMode.admin)
        {


            <li class="layui-nav-item">
                <a href="/Home/UserList">
                    <i class="layui-icon layui-icon-username"></i>
                    用户管理
                </a>
            </li>


        }
        <li class="layui-nav-item">
            <a href="/Home/Index">
                <i class="layui-icon layui-icon-user"></i>
                聊天室
            </a>
        </li>


    </ul>
    <div>
        <div style="clear:both;"></div>
    </div>
    @RenderBody()
    @RenderSection("scripts", required: false)
</body>
</html>
